home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume7 / nethack3 / patch10b < prev    next >
Encoding:
Text File  |  1991-02-08  |  55.6 KB  |  2,052 lines

  1. Subject:  v12i026:  NetHack3 -  display oriented dungeons & dragons (Ver. 3.0), Patch10b
  2. Newsgroups: comp.sources.games
  3. Approved: billr@saab.CNA.TEK.COM
  4.  
  5. Submitted-by: Izchak Miller <izchak@linc.cis.upenn.edu>
  6. Posting-number: Volume 12, Issue 26
  7. Archive-name: NetHack3/Patch10b
  8. Patch-To: NetHack3: Volume 7, Issue 56-93
  9. Environment: 
  10.  
  11.  
  12.  
  13. #! /bin/sh
  14. # This is a shell archive.  Remove anything before this line, then unpack
  15. # it by saving it into a file and typing "sh file".  To overwrite existing
  16. # files, type "sh file -c".  You can also feed this as standard input via
  17. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  18. # will see the following message at the end:
  19. #        "End of archive 2 (of 8)."
  20. # Contents:  do_patch10.sh patch10.03
  21. # Wrapped by billr@saab on Fri Feb  8 17:18:57 1991
  22. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  23. if test -f 'do_patch10.sh' -a "${1}" != "-c" ; then 
  24.   echo shar: Renaming existing file \"'do_patch10.sh'\" to \"'do_patch10.sh.orig'\"
  25.   mv -f 'do_patch10.sh' 'do_patch10.sh.orig'
  26. fi
  27. echo shar: Extracting \"'do_patch10.sh'\" \(354 characters\)
  28. sed "s/^X//" >'do_patch10.sh' <<'END_OF_FILE'
  29. X#! /bin/sh
  30. X# script to call patch to apply diff files
  31. X# make sure all of the patch files (and this file) are in your top level
  32. X# NetHack directory
  33. X#
  34. Xecho "deleting outdated files"
  35. Xrm -f others/exesmurf.uu others/splitf.c others/splitf.uu others/suputils.doc
  36. Xecho "applying patch10"
  37. Xcat patch10.?? | patch -p
  38. Xecho "all patches applied, check for rejects"
  39. END_OF_FILE
  40. if test 354 -ne `wc -c <'do_patch10.sh'`; then
  41.     echo shar: \"'do_patch10.sh'\" unpacked with wrong size!
  42. fi
  43. chmod +x 'do_patch10.sh'
  44. # end of 'do_patch10.sh'
  45. if test -f 'patch10.03' -a "${1}" != "-c" ; then 
  46.   echo shar: Renaming existing file \"'patch10.03'\" to \"'patch10.03.orig'\"
  47.   mv -f 'patch10.03' 'patch10.03.orig'
  48. fi
  49. echo shar: Extracting \"'patch10.03'\" \(52441 characters\)
  50. sed "s/^X//" >'patch10.03' <<'END_OF_FILE'
  51. X*** src/mthrowu.c    Sat May 26 23:17:25 1990
  52. X--- src/mthrowu.c    Fri Feb  1 10:57:41 1991
  53. X***************
  54. X*** 6,12 ****
  55. X  
  56. X  STATIC_DCL int FDECL(movedist,(int,int,int,int));
  57. X  STATIC_DCL void FDECL(drop_throw,(struct obj *,BOOLEAN_P,int,int));
  58. X! STATIC_DCL void FDECL(m_throw,(int,int,int,int,int,struct obj *));
  59. X  
  60. X  #define URETREATING(x,y) (movedist(u.ux,u.uy,x,y) > movedist(u.ux0,u.uy0,x,y))
  61. X  
  62. X--- 6,12 ----
  63. X  
  64. X  STATIC_DCL int FDECL(movedist,(int,int,int,int));
  65. X  STATIC_DCL void FDECL(drop_throw,(struct obj *,BOOLEAN_P,int,int));
  66. X! STATIC_DCL void FDECL(m_throw,(struct monst *,int,int,int,int,int,struct obj *));
  67. X  
  68. X  #define URETREATING(x,y) (movedist(u.ux,u.uy,x,y) > movedist(u.ux0,u.uy0,x,y))
  69. X  
  70. X***************
  71. X*** 99,105 ****
  72. X  #ifdef OVL1
  73. X  
  74. X  STATIC_OVL void
  75. X! m_throw(x, y, dx, dy, range, obj)
  76. X      register int x,y,dx,dy,range;        /* direction and range */
  77. X      register struct obj *obj;
  78. X  {
  79. X--- 99,106 ----
  80. X  #ifdef OVL1
  81. X  
  82. X  STATIC_OVL void
  83. X! m_throw(mon, x, y, dx, dy, range, obj)
  84. X!     register struct monst *mon;
  85. X      register int x,y,dx,dy,range;        /* direction and range */
  86. X      register struct obj *obj;
  87. X  {
  88. X***************
  89. X*** 119,129 ****
  90. X       * after obj.
  91. X       */
  92. X      obj->nobj = singleobj->nobj;
  93. X  
  94. X      if(sym) {
  95. X          tmp_at(-1, sym);    /* open call */
  96. X  #ifdef TEXTCOLOR
  97. X!         tmp_at(-3, (int)objects[obj->otyp].oc_color);
  98. X  #else
  99. X          tmp_at(-3, (int)AT_OBJ);
  100. X  #endif
  101. X--- 120,146 ----
  102. X       * after obj.
  103. X       */
  104. X      obj->nobj = singleobj->nobj;
  105. X+     /* Get rid of object.  This cannot be done later on; what if the
  106. X+      * player dies before then, leaving the monster with 0 daggers?
  107. X+      * (This caused the infamous 2^32-1 orcish dagger bug).
  108. X+      */
  109. X+     if (!obj->quan) {
  110. X+         if(obj->olet == VENOM_SYM) {
  111. X+             /* venom is not in the monster's inventory chain */
  112. X+             free((genericptr_t) obj);
  113. X+         } else {
  114. X+             m_useup(mon, obj);
  115. X+         }
  116. X+     }
  117. X  
  118. X+     /* Note: drop_throw may destroy singleobj.  Since obj must be destroyed
  119. X+      * early to avoid the dagger bug, anyone who modifies this code should
  120. X+      * be careful not to use either one after it's been freed.
  121. X+      */
  122. X      if(sym) {
  123. X          tmp_at(-1, sym);    /* open call */
  124. X  #ifdef TEXTCOLOR
  125. X!         tmp_at(-3, (int)objects[singleobj->otyp].oc_color);
  126. X  #else
  127. X          tmp_at(-3, (int)AT_OBJ);
  128. X  #endif
  129. X***************
  130. X*** 137,143 ****
  131. X          if(MON_AT(bhitpos.x, bhitpos.y)) {
  132. X              mtmp = m_at(bhitpos.x,bhitpos.y);
  133. X  
  134. X!             if(mtmp->data->ac + 8 + obj->spe <= rnd(20)) {
  135. X              if (!vis) pline("It is missed.");
  136. X              else miss(distant_name(singleobj,xname), mtmp);
  137. X              if (!range) { /* Last position; object drops */
  138. X--- 154,160 ----
  139. X          if(MON_AT(bhitpos.x, bhitpos.y)) {
  140. X              mtmp = m_at(bhitpos.x,bhitpos.y);
  141. X  
  142. X!             if(mtmp->data->ac + 8 + singleobj->spe <= rnd(20)) {
  143. X              if (!vis) pline("It is missed.");
  144. X              else miss(distant_name(singleobj,xname), mtmp);
  145. X              if (!range) { /* Last position; object drops */
  146. X***************
  147. X*** 145,158 ****
  148. X                  break;
  149. X              }
  150. X              } else {
  151. X!             damage = dmgval(obj, mtmp->data);
  152. X              if (damage < 1) damage = 1;
  153. X!             if (obj->otyp==ACID_VENOM && resists_acid(mtmp->data))
  154. X                  damage = 0;
  155. X              if (!vis) pline("It is hit%s", exclam(damage));
  156. X              else hit(distant_name(singleobj,xname),
  157. X                              mtmp,exclam(damage));
  158. X!             if (obj->opoisoned) {
  159. X                  if (resists_poison(mtmp->data)) {
  160. X                  if (vis)
  161. X                    pline("The poison doesn't seem to affect %s.",
  162. X--- 162,175 ----
  163. X                  break;
  164. X              }
  165. X              } else {
  166. X!             damage = dmgval(singleobj, mtmp->data);
  167. X              if (damage < 1) damage = 1;
  168. X!             if (singleobj->otyp==ACID_VENOM && resists_acid(mtmp->data))
  169. X                  damage = 0;
  170. X              if (!vis) pline("It is hit%s", exclam(damage));
  171. X              else hit(distant_name(singleobj,xname),
  172. X                              mtmp,exclam(damage));
  173. X!             if (singleobj->opoisoned) {
  174. X                  if (resists_poison(mtmp->data)) {
  175. X                  if (vis)
  176. X                    pline("The poison doesn't seem to affect %s.",
  177. X***************
  178. X*** 166,172 ****
  179. X                  }
  180. X                  }
  181. X              }
  182. X!             if (obj->otyp==SILVER_ARROW && (is_were(mtmp->data)
  183. X                  || is_demon(mtmp->data)
  184. X                  || mtmp->data->mlet == S_VAMPIRE
  185. X                  || (mtmp->data->mlet==S_IMP
  186. X--- 183,189 ----
  187. X                  }
  188. X                  }
  189. X              }
  190. X!             if (singleobj->otyp==SILVER_ARROW && (is_were(mtmp->data)
  191. X                  || is_demon(mtmp->data)
  192. X                  || mtmp->data->mlet == S_VAMPIRE
  193. X                  || (mtmp->data->mlet==S_IMP
  194. X***************
  195. X*** 176,182 ****
  196. X                  else pline("Its flesh is seared!");
  197. X                  damage += rnd(20);
  198. X              }
  199. X!             if (obj->otyp==ACID_VENOM && cansee(mtmp->mx,mtmp->my)){
  200. X                  if (resists_acid(mtmp->data)) {
  201. X                  pline("%s is unaffected.", vis ? Monnam(mtmp)
  202. X                      : "It");
  203. X--- 193,199 ----
  204. X                  else pline("Its flesh is seared!");
  205. X                  damage += rnd(20);
  206. X              }
  207. X!             if (singleobj->otyp==ACID_VENOM && cansee(mtmp->mx,mtmp->my)){
  208. X                  if (resists_acid(mtmp->data)) {
  209. X                  pline("%s is unaffected.", vis ? Monnam(mtmp)
  210. X                      : "It");
  211. X***************
  212. X*** 194,201 ****
  213. X                  mondied(mtmp);
  214. X              }
  215. X  
  216. X!             if((obj->otyp == CREAM_PIE) ||
  217. X!                (obj->otyp == BLINDING_VENOM)) {
  218. X                  if (vis)
  219. X                  pline("%s is blinded by the %s.",
  220. X                        Monnam(mtmp), xname(singleobj));
  221. X--- 211,218 ----
  222. X                  mondied(mtmp);
  223. X              }
  224. X  
  225. X!             if((singleobj->otyp == CREAM_PIE) ||
  226. X!                (singleobj->otyp == BLINDING_VENOM)) {
  227. X                  if (vis)
  228. X                  pline("%s is blinded by the %s.",
  229. X                        Monnam(mtmp), xname(singleobj));
  230. X***************
  231. X*** 215,221 ****
  232. X          if (bhitpos.x == u.ux && bhitpos.y == u.uy) {
  233. X              if (multi) nomul(0);
  234. X  
  235. X!             switch(obj->otyp) {
  236. X                  int dam;
  237. X                  case CREAM_PIE:
  238. X                  case BLINDING_VENOM:
  239. X--- 232,238 ----
  240. X          if (bhitpos.x == u.ux && bhitpos.y == u.uy) {
  241. X              if (multi) nomul(0);
  242. X  
  243. X!             switch(singleobj->otyp) {
  244. X                  int dam;
  245. X                  case CREAM_PIE:
  246. X                  case BLINDING_VENOM:
  247. X***************
  248. X*** 222,240 ****
  249. X                  hitu = thitu(8, 0, singleobj, xname(singleobj));
  250. X                  break;
  251. X                  default:
  252. X!                 dam = dmgval(obj, uasmon);
  253. X                  if (dam < 1) dam = 1;
  254. X!                 hitu = thitu(8+obj->spe, dam, singleobj,
  255. X                      xname(singleobj));
  256. X              }
  257. X!             if (hitu && obj->opoisoned)
  258. X                  /* it's safe to call xname twice because it's the
  259. X                     same object both times... */
  260. X                  poisoned(xname(singleobj), A_STR, xname(singleobj), 10);
  261. X!             if(hitu && (obj->otyp == CREAM_PIE ||
  262. X!                      obj->otyp == BLINDING_VENOM)) {
  263. X                  blindinc = rnd(25);
  264. X!                 if(obj->otyp == CREAM_PIE) {
  265. X                  if(!Blind) pline("Yecch!  You've been creamed.");
  266. X                  else    pline("There's something sticky all over your %s.", body_part(FACE));
  267. X                  } else {    /* venom in the eyes */
  268. X--- 239,257 ----
  269. X                  hitu = thitu(8, 0, singleobj, xname(singleobj));
  270. X                  break;
  271. X                  default:
  272. X!                 dam = dmgval(singleobj, uasmon);
  273. X                  if (dam < 1) dam = 1;
  274. X!                 hitu = thitu(8+singleobj->spe, dam, singleobj,
  275. X                      xname(singleobj));
  276. X              }
  277. X!             if (hitu && singleobj->opoisoned)
  278. X                  /* it's safe to call xname twice because it's the
  279. X                     same object both times... */
  280. X                  poisoned(xname(singleobj), A_STR, xname(singleobj), 10);
  281. X!             if(hitu && (singleobj->otyp == CREAM_PIE ||
  282. X!                      singleobj->otyp == BLINDING_VENOM)) {
  283. X                  blindinc = rnd(25);
  284. X!                 if(singleobj->otyp == CREAM_PIE) {
  285. X                  if(!Blind) pline("Yecch!  You've been creamed.");
  286. X                  else    pline("There's something sticky all over your %s.", body_part(FACE));
  287. X                  } else {    /* venom in the eyes */
  288. X***************
  289. X*** 343,349 ****
  290. X              if (canseemon(mtmp))
  291. X              pline("%s %s %s!", Monnam(mtmp), verb, an(xname(otmp)));
  292. X              otmp->quan = savequan;
  293. X!             m_throw(mtmp->mx, mtmp->my, sgn(tbx), sgn(tby), 
  294. X              movedist(mtmp->mx,mtmp->mux,mtmp->my,mtmp->muy), otmp);
  295. X              if (!otmp->quan) m_useup(mtmp, otmp);
  296. X              nomul(0);
  297. X--- 360,366 ----
  298. X              if (canseemon(mtmp))
  299. X              pline("%s %s %s!", Monnam(mtmp), verb, an(xname(otmp)));
  300. X              otmp->quan = savequan;
  301. X!             m_throw(mtmp, mtmp->mx, mtmp->my, sgn(tbx), sgn(tby), 
  302. X              movedist(mtmp->mx,mtmp->mux,mtmp->my,mtmp->muy), otmp);
  303. X              if (!otmp->quan) m_useup(mtmp, otmp);
  304. X              nomul(0);
  305. X***************
  306. X*** 386,392 ****
  307. X          if(!rn2(BOLT_LIM-movedist(mtmp->mx,mtmp->mux,mtmp->my,mtmp->muy))) {
  308. X              if (canseemon(mtmp))
  309. X              pline("%s spits venom!", Monnam(mtmp));
  310. X!             m_throw(mtmp->mx, mtmp->my, sgn(tbx), sgn(tby), 
  311. X              movedist(mtmp->mx,mtmp->mux,mtmp->my,mtmp->muy), otmp);
  312. X              nomul(0);
  313. X              return 0;
  314. X--- 403,409 ----
  315. X          if(!rn2(BOLT_LIM-movedist(mtmp->mx,mtmp->mux,mtmp->my,mtmp->muy))) {
  316. X              if (canseemon(mtmp))
  317. X              pline("%s spits venom!", Monnam(mtmp));
  318. X!             m_throw(mtmp, mtmp->mx, mtmp->my, sgn(tbx), sgn(tby), 
  319. X              movedist(mtmp->mx,mtmp->mux,mtmp->my,mtmp->muy), otmp);
  320. X              nomul(0);
  321. X              return 0;
  322. X*** src/o_init.c    Wed May  9 09:24:18 1990
  323. X--- src/o_init.c    Wed Jan 30 08:48:38 1991
  324. X***************
  325. X*** 241,247 ****
  326. X  #ifdef MACOS
  327. X      char    *descr[TOTAL_OBJS];
  328. X  #endif
  329. X!     struct objclass *now = &objects[0];
  330. X      bwrite(fd, (genericptr_t)&now, sizeof now);
  331. X      bwrite(fd, (genericptr_t)bases, sizeof bases);
  332. X      bwrite(fd, (genericptr_t)disco, sizeof disco);
  333. X--- 241,247 ----
  334. X  #ifdef MACOS
  335. X      char    *descr[TOTAL_OBJS];
  336. X  #endif
  337. X!     const char *now = objects[0].oc_name; /* location of "strange object" */
  338. X      bwrite(fd, (genericptr_t)&now, sizeof now);
  339. X      bwrite(fd, (genericptr_t)bases, sizeof bases);
  340. X      bwrite(fd, (genericptr_t)disco, sizeof disco);
  341. X***************
  342. X*** 273,280 ****
  343. X  {
  344. X      register int i;
  345. X      unsigned int len;
  346. X!     struct objclass *then;
  347. X!     long differ;
  348. X  #ifdef MACOS
  349. X      /* provides position-independent save & restore */
  350. X      /* by giving each object a number, keep track of it */
  351. X--- 273,280 ----
  352. X  {
  353. X      register int i;
  354. X      unsigned int len;
  355. X!     char *then;    /* old location of "strange object" */
  356. X!     register int differ;    /*(ptrdiff_t)*/
  357. X  #ifdef MACOS
  358. X      /* provides position-independent save & restore */
  359. X      /* by giving each object a number, keep track of it */
  360. X***************
  361. X*** 305,334 ****
  362. X          objects[i].oc_descr = d[switches[i]].descr;
  363. X      }
  364. X  #else
  365. X! # if !defined(MSDOS) && !defined(M_XENIX) && !defined(HPUX) && !defined(VAXC)
  366. X!     differ = (genericptr_t)&objects[0] - (genericptr_t)then;
  367. X! # else
  368. X!     differ = (long)&objects[0] - (long)then;
  369. X! # endif
  370. X  #endif    /* MACOS */
  371. X      for(i=0; i < TOTAL_OBJS; i++) {
  372. X  #ifndef MACOS
  373. X!         if (objects[i].oc_name) {
  374. X! # if !defined(MSDOS) && !defined(M_XENIX) && !defined(HPUX) && !defined(VAXC)
  375. X              objects[i].oc_name += differ;
  376. X! # else
  377. X!             objects[i].oc_name =
  378. X!                 (const char *)((long)(objects[i].oc_name) + differ);
  379. X! # endif
  380. X!         }
  381. X!         if (objects[i].oc_descr) {
  382. X! # if !defined(MSDOS) && !defined(M_XENIX) && !defined(HPUX) && !defined(VAXC)
  383. X              objects[i].oc_descr += differ;
  384. X- # else
  385. X-             objects[i].oc_descr =
  386. X-                 (const char *)((long)(objects[i].oc_descr) + differ);
  387. X- # endif
  388. X-         }
  389. X  #endif /* MACOS */
  390. X          if (objects[i].oc_uname) {
  391. X              mread(fd, (genericptr_t) &len, sizeof len);
  392. X--- 305,318 ----
  393. X          objects[i].oc_descr = d[switches[i]].descr;
  394. X      }
  395. X  #else
  396. X!     differ = objects[0].oc_name - then;    /* note: expected to be 0 */
  397. X  #endif    /* MACOS */
  398. X      for(i=0; i < TOTAL_OBJS; i++) {
  399. X  #ifndef MACOS
  400. X!         if (differ && objects[i].oc_name)
  401. X              objects[i].oc_name += differ;
  402. X!         if (differ && objects[i].oc_descr)
  403. X              objects[i].oc_descr += differ;
  404. X  #endif /* MACOS */
  405. X          if (objects[i].oc_uname) {
  406. X              mread(fd, (genericptr_t) &len, sizeof len);
  407. X*** src/objnam.c    Mon Jun  4 13:04:34 1990
  408. X--- src/objnam.c    Tue Jan 15 17:50:50 1991
  409. X***************
  410. X*** 9,15 ****
  411. X  
  412. X  /* "an uncursed partly eaten guardian naga hatchling corpse" */
  413. X  #define    PREFIX    50
  414. X! #define SCHAR_MAX 127
  415. X  
  416. X  #ifndef OVLB
  417. X  
  418. X--- 9,15 ----
  419. X  
  420. X  /* "an uncursed partly eaten guardian naga hatchling corpse" */
  421. X  #define    PREFIX    50
  422. X! #define SCHAR_LIM 127
  423. X  
  424. X  #ifndef OVLB
  425. X  
  426. X***************
  427. X*** 1175,1182 ****
  428. X          spesgn = -1;    /* cheaters get what they deserve */
  429. X          spe = abs(spe);
  430. X      }
  431. X!     if (spe > SCHAR_MAX)
  432. X!         spe = SCHAR_MAX;
  433. X  
  434. X      /* now we have the actual name, as delivered by xname, say
  435. X          green potions called whisky
  436. X--- 1175,1182 ----
  437. X          spesgn = -1;    /* cheaters get what they deserve */
  438. X          spe = abs(spe);
  439. X      }
  440. X!     if (spe > SCHAR_LIM)
  441. X!         spe = SCHAR_LIM;
  442. X  
  443. X      /* now we have the actual name, as delivered by xname, say
  444. X          green potions called whisky
  445. X*** src/options.c    Tue Jun 26 21:20:29 1990
  446. X--- src/options.c    Tue Jan  8 09:39:45 1991
  447. X***************
  448. X*** 18,23 ****
  449. X--- 18,26 ----
  450. X  initoptions()
  451. X  {
  452. X      register char *opts;
  453. X+ #ifdef MACOS
  454. X+     char keepname[PL_NSIZ];  /* for save file starts */
  455. X+ #endif
  456. X  
  457. X      flags.time = flags.nonews = flags.notombstone = flags.end_own =
  458. X      flags.standout = flags.nonull = flags.ignintr = FALSE;
  459. X***************
  460. X*** 55,61 ****
  461. X--- 58,67 ----
  462. X      read_config_file();
  463. X  #endif /* MSDOS */
  464. X  #ifdef MACOS
  465. X+     if (plname[0] == '\0') keepname[0] = '\0';
  466. X+     else Strcpy(keepname, plname);  /* keep name from save file */
  467. X      read_config_file();
  468. X+     if (keepname[0] != '\0') Strcpy(plname, keepname);
  469. X      flags.standout = TRUE;    
  470. X  #endif
  471. X      if(opts = getenv("NETHACKOPTIONS"))
  472. X***************
  473. X*** 62,70 ****
  474. X          parseoptions(opts,TRUE);
  475. X  #ifdef TUTTI_FRUTTI
  476. X      (void)fruitadd(pl_fruit);
  477. X!     objects[SLIME_MOLD].oc_name = "\033";
  478. X!     /* Put something untypable in there */
  479. X!     /* We cannot just use NULL because that marks the end of objects */
  480. X  #endif
  481. X  }
  482. X  
  483. X--- 68,78 ----
  484. X          parseoptions(opts,TRUE);
  485. X  #ifdef TUTTI_FRUTTI
  486. X      (void)fruitadd(pl_fruit);
  487. X!     /* Remove "slime mold" from list of object names; this will    */
  488. X!     /* prevent it from being wished unless it's actually present    */
  489. X!     /* as a named (or default) fruit.  Wishing for "fruit" will    */
  490. X!     /* result in the player's preferred fruit [better than "\033"].    */
  491. X!     objects[SLIME_MOLD].oc_name = "fruit";
  492. X  #endif
  493. X  }
  494. X  
  495. X***************
  496. X*** 171,177 ****
  497. X  assign_ibm_graphics()
  498. X  {
  499. X  #ifdef ASCIIGRAPH
  500. X!     flags.IBMgraphics = TRUE;    /* not set from command line */
  501. X  
  502. X      showsyms[S_vwall] = 0xb3;    /* meta-3, vertical rule */
  503. X      showsyms[S_hwall] = 0xc4;    /* meta-D, horizontal rule */
  504. X--- 179,186 ----
  505. X  assign_ibm_graphics()
  506. X  {
  507. X  #ifdef ASCIIGRAPH
  508. X!     flags.IBMgraphics = TRUE;
  509. X!     flags.DECgraphics = FALSE;
  510. X  
  511. X      showsyms[S_vwall] = 0xb3;    /* meta-3, vertical rule */
  512. X      showsyms[S_hwall] = 0xc4;    /* meta-D, horizontal rule */
  513. X***************
  514. X*** 199,205 ****
  515. X  assign_dec_graphics()
  516. X  {
  517. X  #ifdef TERMLIB
  518. X!     flags.DECgraphics = TRUE;    /* not set from command line */
  519. X  
  520. X      showsyms[S_vwall] = 0xf8;    /* vertical rule */
  521. X      showsyms[S_hwall] = 0xf1;    /* horizontal rule */
  522. X--- 208,215 ----
  523. X  assign_dec_graphics()
  524. X  {
  525. X  #ifdef TERMLIB
  526. X!     flags.DECgraphics = TRUE;
  527. X!     flags.IBMgraphics = FALSE;
  528. X  
  529. X      showsyms[S_vwall] = 0xf8;    /* vertical rule */
  530. X      showsyms[S_hwall] = 0xf1;    /* horizontal rule */
  531. X***************
  532. X*** 299,304 ****
  533. X--- 309,317 ----
  534. X  
  535. X      if (!strncmp(opts, "num", 3)) {
  536. X          flags.num_pad = !negated;
  537. X+ #ifndef AMIGA
  538. X+         if (!from_env) number_pad(flags.num_pad ? 1 : 0);
  539. X+ #endif
  540. X          return;
  541. X      }
  542. X  
  543. X*** src/panic.c    Sun Mar  4 13:44:05 1990
  544. X--- src/panic.c    Tue Jan 29 09:13:55 1991
  545. X***************
  546. X*** 6,12 ****
  547. X   */
  548. X  /* NetHack may be freely redistributed.  See license for details. */
  549. X  
  550. X! #define NEED_VARARGS
  551. X  #include    "config.h"
  552. X  
  553. X  #ifdef MSDOS
  554. X--- 6,12 ----
  555. X   */
  556. X  /* NetHack may be freely redistributed.  See license for details. */
  557. X  
  558. X! #define NEED_VARARGS /* Uses ... */    /* comment line for pre-compiled headers */
  559. X  #include    "config.h"
  560. X  
  561. X  #ifdef MSDOS
  562. X*** src/pickup.c    Tue Jun 26 21:20:30 1990
  563. X--- src/pickup.c    Mon Feb  4 09:57:07 1991
  564. X***************
  565. X*** 278,284 ****
  566. X              pline("There %s %s here, but %s.",
  567. X                  (obj->quan == 1) ? "is" : "are",
  568. X                  doname(obj),
  569. X!                 !invent ? "it is too heavy for you to lift"
  570. X                      : "you cannot carry any more");
  571. X                  if(obj->otyp == SCR_SCARE_MONSTER)
  572. X                      if(obj->spe) obj->spe = 0;
  573. X--- 278,287 ----
  574. X              pline("There %s %s here, but %s.",
  575. X                  (obj->quan == 1) ? "is" : "are",
  576. X                  doname(obj),
  577. X!                 !invent ? 
  578. X!                 (obj->quan == 1 ?
  579. X!                     "it is too heavy for you to lift"
  580. X!                   : "they are too heavy for you to lift")
  581. X                      : "you cannot carry any more");
  582. X                  if(obj->otyp == SCR_SCARE_MONSTER)
  583. X                      if(obj->spe) obj->spe = 0;
  584. X***************
  585. X*** 619,636 ****
  586. X  struct obj *obj;
  587. X  {
  588. X      struct obj *otmp, *cobj;
  589. X  
  590. X      cobj = obj->cobj;
  591. X      delete_contents(cobj);
  592. X  
  593. X      for (otmp = invent; otmp; otmp = otmp->nobj)
  594. X!         if (otmp == cobj) break;
  595. X  
  596. X!     if (otmp) {
  597. X!         You("see your %s blow apart!", xname(otmp));
  598. X!         useup(otmp);
  599. X!         /*return(0);*/
  600. X!     } else    panic("explode_bag: bag not in invent.");
  601. X  }
  602. X  
  603. X  void
  604. X--- 622,652 ----
  605. X  struct obj *obj;
  606. X  {
  607. X      struct obj *otmp, *cobj;
  608. X+     boolean found = FALSE;
  609. X  
  610. X      cobj = obj->cobj;
  611. X      delete_contents(cobj);
  612. X  
  613. X      for (otmp = invent; otmp; otmp = otmp->nobj)
  614. X!         if (otmp == cobj) {
  615. X!             found = TRUE;
  616. X!             Your("%s blows apart!", xname(otmp));
  617. X!             useup(otmp);
  618. X!             break;
  619. X!         }
  620. X  
  621. X!     if (!found) {
  622. X!         /* maybe the bag was on the floor */
  623. X!         for (otmp=level.objects[u.ux][u.uy]; otmp; otmp=otmp->nexthere)
  624. X!         if (otmp == cobj) {
  625. X!             found = TRUE;
  626. X!             pline("The %s blows apart!", xname(otmp));
  627. X!             useupf(otmp);
  628. X!             break;
  629. X!         }
  630. X!     }
  631. X! 
  632. X!     if (!found) panic("explode_bag: bag not found.");
  633. X  }
  634. X  
  635. X  void
  636. X*** src/polyself.c    Thu May 31 00:31:48 1990
  637. X--- src/polyself.c    Sat Jan  5 14:59:48 1991
  638. X***************
  639. X*** 123,130 ****
  640. X--- 123,136 ----
  641. X          }
  642. X          (void)strcat(SAVEF, ".sav");
  643. X  # else
  644. X+ #  ifdef MACOS
  645. X+         strncpy(SAVEF, plname, (FILENAME - 2));  /* .e */
  646. X+         SAVEF[(FILENAME - 2)] = '\0';
  647. X+         regularize(SAVEF);
  648. X+ #  else
  649. X          Sprintf(SAVEF, "save/%d%s", getuid(), plname);
  650. X          regularize(SAVEF+5);        /* avoid . or / in name */
  651. X+ #  endif
  652. X  # endif
  653. X  #endif
  654. X  #ifdef WIZARD
  655. X***************
  656. X*** 135,140 ****
  657. X--- 141,148 ----
  658. X      skinback();
  659. X      find_ac();
  660. X      if (sticky) uunstick();
  661. X+     if(is_pool(u.ux,u.uy) && !Levitation && !u.ustuck && !Wwalking)
  662. X+         drown();
  663. X  #endif
  664. X  }
  665. X  
  666. X***************
  667. X*** 326,331 ****
  668. X--- 334,342 ----
  669. X          pline("Use the command #sit to lay an egg.");
  670. X      }
  671. X      find_ac();
  672. X+     if(is_pool(u.ux,u.uy) && !Levitation && !u.ustuck && !Wwalking
  673. X+             && !is_flyer(uasmon) && !is_swimmer(uasmon))
  674. X+         drown();
  675. X      return(1);
  676. X  }
  677. X  
  678. X***************
  679. X*** 450,460 ****
  680. X      prme();
  681. X      flags.botl = 1;
  682. X      find_ac();
  683. X  }
  684. X  
  685. X  int
  686. X  dobreathe() {
  687. X!     if(!getdir(1)) return(0);
  688. X      if (rn2(4))
  689. X          You("produce a loud and noxious belch.");
  690. X      else {
  691. X--- 461,477 ----
  692. X      prme();
  693. X      flags.botl = 1;
  694. X      find_ac();
  695. X+     if(is_pool(u.ux,u.uy) && !Levitation && !u.ustuck && !Wwalking)
  696. X+         drown();
  697. X  }
  698. X  
  699. X  int
  700. X  dobreathe() {
  701. X!     if (Strangled) {
  702. X!         You("can't breathe.  Sorry.");
  703. X!         return(0);
  704. X!     }
  705. X!     if (!getdir(1)) return(0);
  706. X      if (rn2(4))
  707. X          You("produce a loud and noxious belch.");
  708. X      else {
  709. X*** src/potion.c    Fri Jun  1 16:59:24 1990
  710. X--- src/potion.c    Thu Jan 31 11:24:54 1991
  711. X***************
  712. X*** 516,523 ****
  713. X  #ifdef SPELLS
  714. X      case SPE_HASTE_SELF:
  715. X  #endif
  716. X!         if(!(Fast & TIMEOUT))
  717. X!             You("are suddenly moving much faster.");
  718. X          else {
  719. X              Your("%s get new energy.",
  720. X                  makeplural(body_part(LEG)));
  721. X--- 516,524 ----
  722. X  #ifdef SPELLS
  723. X      case SPE_HASTE_SELF:
  724. X  #endif
  725. X!         if(!(Fast & ~INTRINSIC)) /* wwf@doe.carleton.ca */
  726. X!             You("are suddenly moving %sfaster.",
  727. X!                 Fast ? "" : "much ");
  728. X          else {
  729. X              Your("%s get new energy.",
  730. X                  makeplural(body_part(LEG)));
  731. X***************
  732. X*** 537,542 ****
  733. X--- 538,546 ----
  734. X              if((dlevel > 1  || u.uhave_amulet) &&
  735. X                              dlevel <= MAXLEVEL) { 
  736. X                  You("rise up, through the ceiling!");
  737. X+ # ifdef MACOS
  738. X+                 segments |= SEG_POTION;
  739. X+ # endif
  740. X                  goto_level((dlevel==1) ? ENDLEVEL
  741. X                      : dlevel-1, FALSE, FALSE);
  742. X              } else You("have an uneasy feeling.");
  743. X***************
  744. X*** 543,551 ****
  745. X  #else
  746. X              if(dlevel > 1 && dlevel <= MAXLEVEL) {
  747. X                  You("rise up, through the ceiling!");
  748. X! #ifdef MACOS
  749. X                  segments |= SEG_POTION;
  750. X! #endif
  751. X                  goto_level(dlevel-1, FALSE, FALSE);
  752. X              } else You("have an uneasy feeling.");
  753. X  #endif
  754. X--- 547,555 ----
  755. X  #else
  756. X              if(dlevel > 1 && dlevel <= MAXLEVEL) {
  757. X                  You("rise up, through the ceiling!");
  758. X! # ifdef MACOS
  759. X                  segments |= SEG_POTION;
  760. X! # endif
  761. X                  goto_level(dlevel-1, FALSE, FALSE);
  762. X              } else You("have an uneasy feeling.");
  763. X  #endif
  764. X*** src/prisym.co    Wed Feb 06 04:41:48 1991
  765. X--- src/prisym.c    Wed Feb 06 04:48:30 1991
  766. X***************
  767. X*** 24,30 ****
  768. X          impossible("atl(%d,%d,%c)",x,y,ch);
  769. X          return;
  770. X      }
  771. X!     if(crm->seen && crm->scrsym == ch) return;
  772. X      /* crm->scrsym = (uchar) ch; */
  773. X      /* wrong if characters are signed but uchar is larger than char,
  774. X       * and ch, when passed, was greater than 127.
  775. X--- 24,38 ----
  776. X          impossible("atl(%d,%d,%c)",x,y,ch);
  777. X          return;
  778. X      }
  779. X!     if(crm->seen && crm->scrsym == ch
  780. X! #ifdef TEXTCOLOR
  781. X!     /* Force update if color used.  Otherwise objects with
  782. X!      * same screen symbols but different colors show up
  783. X!      * in wrong color in certain situations.
  784. X!      */
  785. X!        && !flags.use_color
  786. X! #endif
  787. X!       ) return;
  788. X      /* crm->scrsym = (uchar) ch; */
  789. X      /* wrong if characters are signed but uchar is larger than char,
  790. X       * and ch, when passed, was greater than 127.
  791. X*** src/read.c    Thu May 31 15:56:51 1990
  792. X--- src/read.c    Wed Jan 16 16:42:50 1991
  793. X***************
  794. X*** 714,720 ****
  795. X              if(!Blind)
  796. X                  pline("Oh, look, what a pretty fire in your %s.",
  797. X                  makeplural(body_part(HAND)));
  798. X!             else You("feal a pleasant warmth in your %s.",
  799. X                  makeplural(body_part(HAND)));
  800. X              } else {
  801. X              pline("The scroll catches fire and you burn your %s.",
  802. X--- 714,720 ----
  803. X              if(!Blind)
  804. X                  pline("Oh, look, what a pretty fire in your %s.",
  805. X                  makeplural(body_part(HAND)));
  806. X!             else You("feel a pleasant warmth in your %s.",
  807. X                  makeplural(body_part(HAND)));
  808. X              } else {
  809. X              pline("The scroll catches fire and you burn your %s.",
  810. X*** src/restore.c    Tue Jun 26 21:20:31 1990
  811. X--- src/restore.c    Sun Jan  6 15:55:35 1991
  812. X***************
  813. X*** 152,167 ****
  814. X      register struct monst *mtmp, *mtmp2;
  815. X      register struct monst *first = 0;
  816. X      int xl;
  817. X- 
  818. X      struct permonst *monbegin;
  819. X!     off_t differ;
  820. X  
  821. X      mread(fd, (genericptr_t)&monbegin, sizeof(monbegin));
  822. X! #if !defined(MSDOS) && !defined(M_XENIX) && !defined(THINKC4) && !defined(HPUX) && !defined(VAXC)
  823. X!     differ = (genericptr_t)(&mons[0]) - (genericptr_t)(monbegin);
  824. X! #else
  825. X!     differ = (long)(&mons[0]) - (long)(monbegin);
  826. X! #endif
  827. X  
  828. X  #if defined(LINT) || defined(__GNULINT__)
  829. X      /* suppress "used before set" warning from lint */
  830. X--- 152,163 ----
  831. X      register struct monst *mtmp, *mtmp2;
  832. X      register struct monst *first = 0;
  833. X      int xl;
  834. X      struct permonst *monbegin;
  835. X!     boolean moved;
  836. X  
  837. X+     /* get the original base address */
  838. X      mread(fd, (genericptr_t)&monbegin, sizeof(monbegin));
  839. X!     moved = (monbegin != mons);
  840. X  
  841. X  #if defined(LINT) || defined(__GNULINT__)
  842. X      /* suppress "used before set" warning from lint */
  843. X***************
  844. X*** 176,199 ****
  845. X          mread(fd, (genericptr_t) mtmp, (unsigned) xl + sizeof(struct monst));
  846. X          if(!mtmp->m_id)
  847. X              mtmp->m_id = flags.ident++;
  848. X! #if !defined(MSDOS) && !defined(M_XENIX) && !defined(THINKC4) && !defined(HPUX) && !defined(VAXC)
  849. X!         /* ANSI type for differ is ptrdiff_t --
  850. X!          * long may be wrong for segmented architecture --
  851. X!          * may be better to cast pointers to (struct permonst *)
  852. X!          * rather than (genericptr_t)
  853. X!          * this code handles save file -- so any bug should glow
  854. X!          * probably best not to keep lint from complaining
  855. X!          */
  856. X! /*#ifdef LINT    /* possible compiler/hardware dependency - */
  857. X! /*        if (differ) mtmp->data = NULL;*/
  858. X! /*#else*/
  859. X!         mtmp->data = (struct permonst *)
  860. X!             ((genericptr_t)mtmp->data + differ);
  861. X! /*#endif    /*LINT*/
  862. X! #else
  863. X!         mtmp->data = (struct permonst *)
  864. X!             ((long) mtmp->data + differ);
  865. X! #endif
  866. X          if(mtmp->minvent)
  867. X              mtmp->minvent = restobjchn(fd, ghostly);
  868. X          mtmp2 = mtmp;
  869. X--- 172,181 ----
  870. X          mread(fd, (genericptr_t) mtmp, (unsigned) xl + sizeof(struct monst));
  871. X          if(!mtmp->m_id)
  872. X              mtmp->m_id = flags.ident++;
  873. X!         if (moved && mtmp->data) {
  874. X!             int offset = mtmp->data - monbegin;    /*(ptrdiff_t)*/
  875. X!             mtmp->data = mons + offset;  /* new permonst location */
  876. X!         }
  877. X          if(mtmp->minvent)
  878. X              mtmp->minvent = restobjchn(fd, ghostly);
  879. X          mtmp2 = mtmp;
  880. X***************
  881. X*** 885,892 ****
  882. X          }
  883. X      }
  884. X  #endif
  885. X!     if(ghostly && lev > medusa_level && lev < stronghold_level &&
  886. X!                         xdnstair == 0) {
  887. X          coord cc;
  888. X  
  889. X          mazexy(&cc);
  890. X--- 867,879 ----
  891. X          }
  892. X      }
  893. X  #endif
  894. X!     if(ghostly && lev > medusa_level
  895. X! #ifdef STRONGHOLD
  896. X!                 && lev < stronghold_level
  897. X! #else
  898. X!                 && !Inhell
  899. X! #endif
  900. X!                 && xdnstair == 0) {
  901. X          coord cc;
  902. X  
  903. X          mazexy(&cc);
  904. X*** src/save.c    Sat May 26 08:35:56 1990
  905. X--- src/save.c    Sat Jan  5 15:07:00 1991
  906. X***************
  907. X*** 333,338 ****
  908. X--- 333,349 ----
  909. X      bflush(fd);
  910. X  #endif
  911. X      (void) close(fd);
  912. X+ #if defined(VMS) && !defined(SECURE)
  913. X+     /*
  914. X+        Make sure the save file is owned by the current process.  That's
  915. X+        the default for non-privileged users, but for priv'd users the
  916. X+        file will be owned by the directory's owner instead of the user.
  917. X+      */
  918. X+ # ifdef getuid    /*(see vmsunix.c)*/
  919. X+ #  undef getuid
  920. X+ # endif
  921. X+     (void) chown(SAVEF, getuid(), getgid());
  922. X+ #endif /* VMS && !SECURE */
  923. X      glo(dlevel);
  924. X      (void) unlink(lock);    /* get rid of current level --jgm */
  925. X      glo(0);
  926. X*** src/shk.c    Thu May 31 21:34:50 1990
  927. X--- src/shk.c    Sat Jan  5 15:01:22 1991
  928. X***************
  929. X*** 830,836 ****
  930. X      if (ANGRY(shopkeeper) || 
  931. X          (pl_character[0] == 'T' && u.ulevel < (MAXULEV/2))
  932. X  #ifdef SHIRT
  933. X!         || (uarmu && !uarm) /* wearing just a Hawaiian shirt */
  934. X  #endif
  935. X         )
  936. X          tmp += tmp/3;
  937. X--- 830,836 ----
  938. X      if (ANGRY(shopkeeper) || 
  939. X          (pl_character[0] == 'T' && u.ulevel < (MAXULEV/2))
  940. X  #ifdef SHIRT
  941. X!         || (uarmu && !uarm && !uarmc) /* wearing just a Hawaiian shirt */
  942. X  #endif
  943. X         )
  944. X          tmp += tmp/3;
  945. X***************
  946. X*** 840,845 ****
  947. X--- 840,848 ----
  948. X      else if (ACURR(A_CHA) < 6)    tmp *= 2;
  949. X      else if (ACURR(A_CHA) < 8)    tmp = (tmp * 3)/2;
  950. X      else if (ACURR(A_CHA) < 11)    tmp = (tmp * 4)/3;
  951. X+ #ifdef NAMED_ITEMS
  952. X+     if (is_artifact(obj))        tmp *= 4;
  953. X+ #endif
  954. X      if (!tmp) return 1;
  955. X      return(tmp);
  956. X  }
  957. X***************
  958. X*** 1135,1140 ****
  959. X--- 1138,1146 ----
  960. X          pline("Strange... carrying a chain?");
  961. X          break;
  962. X      }
  963. X+ #ifdef NAMED_ITEMS
  964. X+     if (is_artifact(obj)) tmp *= 25;
  965. X+ #endif
  966. X      return(tmp);
  967. X  }
  968. X  
  969. X*** src/sounds.c    Thu May 31 15:56:55 1990
  970. X--- src/sounds.c    Sat Jan  5 14:59:56 1991
  971. X***************
  972. X*** 239,244 ****
  973. X--- 239,245 ----
  974. X  growl(mtmp)
  975. X  register struct monst *mtmp;
  976. X  {
  977. X+     if (mtmp->msleep || !mtmp->mcanmove) return;
  978. X      /* presumably nearness and soundok checks have already been made */
  979. X      switch (mtmp->data->msound) {
  980. X      case MS_SILENT:
  981. X***************
  982. X*** 274,279 ****
  983. X--- 275,281 ----
  984. X  register struct monst *mtmp;
  985. X  /* the sounds of mistreated pets */
  986. X  {
  987. X+     if (mtmp->msleep || !mtmp->mcanmove) return;
  988. X      /* presumably nearness and soundok checks have already been made */
  989. X      switch (mtmp->data->msound) {
  990. X      case MS_MEW:
  991. X***************
  992. X*** 300,305 ****
  993. X--- 302,308 ----
  994. X  register struct monst *mtmp;
  995. X  /* the sounds of distressed pets */
  996. X  {
  997. X+     if (mtmp->msleep || !mtmp->mcanmove) return;
  998. X      /* presumably nearness and soundok checks have already been made */
  999. X      switch (mtmp->data->msound) {
  1000. X      case MS_MEW:
  1001. X***************
  1002. X*** 345,351 ****
  1003. X  domonnoise(mtmp)
  1004. X  register struct monst *mtmp;
  1005. X  {
  1006. X!     /* presumably nearness checks have already been made */
  1007. X      if (!flags.soundok) return(0);
  1008. X      switch (mtmp->data->msound) {
  1009. X  #ifdef ORACLE
  1010. X--- 348,354 ----
  1011. X  domonnoise(mtmp)
  1012. X  register struct monst *mtmp;
  1013. X  {
  1014. X!     /* presumably nearness and sleep checks have already been made */
  1015. X      if (!flags.soundok) return(0);
  1016. X      switch (mtmp->data->msound) {
  1017. X  #ifdef ORACLE
  1018. X*** src/steal.c    Thu May 31 15:56:56 1990
  1019. X--- src/steal.c    Sat Jan  5 15:01:12 1991
  1020. X***************
  1021. X*** 104,110 ****
  1022. X      /* the following is true if successful on first of two attacks. */
  1023. X      if(!monnear(mtmp, u.ux, u.uy)) return(0);
  1024. X  
  1025. X!     if(!invent){
  1026. X          /* Not even a thousand men in armor can strip a naked man. */
  1027. X          if(Blind)
  1028. X            pline("Somebody tries to rob you, but finds nothing to steal.");
  1029. X--- 104,114 ----
  1030. X      /* the following is true if successful on first of two attacks. */
  1031. X      if(!monnear(mtmp, u.ux, u.uy)) return(0);
  1032. X  
  1033. X!     if(!invent
  1034. X! #ifdef POLYSELF
  1035. X!            || (inv_cnt() == 1 && uskin)
  1036. X! #endif
  1037. X!                         ){
  1038. X          /* Not even a thousand men in armor can strip a naked man. */
  1039. X          if(Blind)
  1040. X            pline("Somebody tries to rob you, but finds nothing to steal.");
  1041. X***************
  1042. X*** 123,134 ****
  1043. X      }
  1044. X  
  1045. X      tmp = 0;
  1046. X!     for(otmp = invent; otmp; otmp = otmp->nobj) if(!uarm || otmp != uarmc)
  1047. X!         tmp += ((otmp->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL)) ? 5 : 1);
  1048. X      tmp = rn2(tmp);
  1049. X!     for(otmp = invent; otmp; otmp = otmp->nobj) if(!uarm || otmp != uarmc)
  1050. X!           if((tmp -= ((otmp->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL)) ? 5 : 1))
  1051. X!             < 0) break;
  1052. X      if(!otmp) {
  1053. X          impossible("Steal fails!");
  1054. X          return(0);
  1055. X--- 127,150 ----
  1056. X      }
  1057. X  
  1058. X      tmp = 0;
  1059. X!     for(otmp = invent; otmp; otmp = otmp->nobj)
  1060. X!         if((!uarm || otmp != uarmc)
  1061. X! #ifdef POLYSELF
  1062. X!                     && otmp != uskin
  1063. X! #endif
  1064. X!                             )
  1065. X!         tmp += ((otmp->owornmask &
  1066. X!             (W_ARMOR | W_RING | W_AMUL | W_TOOL)) ? 5 : 1);
  1067. X      tmp = rn2(tmp);
  1068. X!     for(otmp = invent; otmp; otmp = otmp->nobj)
  1069. X!         if((!uarm || otmp != uarmc)
  1070. X! #ifdef POLYSELF
  1071. X!                     && otmp != uskin
  1072. X! #endif
  1073. X!                             )
  1074. X!         if((tmp -= ((otmp->owornmask &
  1075. X!             (W_ARMOR | W_RING | W_AMUL | W_TOOL)) ? 5 : 1)) < 0)
  1076. X!             break;
  1077. X      if(!otmp) {
  1078. X          impossible("Steal fails!");
  1079. X          return(0);
  1080. X*** src/termcap.c    Tue Jun 26 21:20:32 1990
  1081. X--- src/termcap.c    Thu Jan 10 09:52:41 1991
  1082. X***************
  1083. X*** 56,61 ****
  1084. X--- 56,62 ----
  1085. X  #endif
  1086. X  
  1087. X  #ifdef OVLB
  1088. X+ static char *KS = NULL, *KE = NULL;    /* keypad sequences */
  1089. X  static char nullstr[] = "";
  1090. X  #endif /* OVLB */
  1091. X  
  1092. X***************
  1093. X*** 82,91 ****
  1094. X  
  1095. X  #ifdef TERMLIB
  1096. X  # ifdef VMS
  1097. X!     term = getenv("EMACS_TERM");
  1098. X      if (!term)
  1099. X-         term = getenv("NETHACK_TERM");
  1100. X-     if (!term)
  1101. X  # endif
  1102. X      term = getenv("TERM");
  1103. X  #endif
  1104. X--- 83,92 ----
  1105. X  
  1106. X  #ifdef TERMLIB
  1107. X  # ifdef VMS
  1108. X!     term = verify_termcap();    /* jump thru some hoops */
  1109. X!     if (!term) term = getenv("NETHACK_TERM");
  1110. X!     if (!term) term = getenv("EMACS_TERM");
  1111. X      if (!term)
  1112. X  # endif
  1113. X      term = getenv("TERM");
  1114. X  #endif
  1115. X***************
  1116. X*** 231,249 ****
  1117. X          error("Unknown terminal type: %s.", term);
  1118. X      if(pc = Tgetstr("pc"))
  1119. X          PC = *pc;
  1120. X  # ifdef TERMINFO
  1121. X!     if(!(BC = Tgetstr("le"))) {    
  1122. X  # else
  1123. X!     if(!(BC = Tgetstr("bc"))) {    
  1124. X! # endif
  1125. X! # if !defined(MINIMAL_TERM) && !defined(HISX)
  1126. X          if(!tgetflag("bs"))
  1127. X              error("Terminal must backspace.");
  1128. X! # endif
  1129. X          BC = tbufptr;
  1130. X          tbufptr += 2;
  1131. X          *BC = '\b';
  1132. X!     }
  1133. X  # ifdef MINIMAL_TERM
  1134. X      HO = NULL;
  1135. X  # else
  1136. X--- 232,253 ----
  1137. X          error("Unknown terminal type: %s.", term);
  1138. X      if(pc = Tgetstr("pc"))
  1139. X          PC = *pc;
  1140. X+ 
  1141. X+     if(!(BC = Tgetstr("le")))    /* both termcap and terminfo use le */    
  1142. X  # ifdef TERMINFO
  1143. X!         error("Terminal must backspace.");
  1144. X  # else
  1145. X!         if(!(BC = Tgetstr("bc"))) {    /* termcap also uses bc/bs */
  1146. X! #  if !defined(MINIMAL_TERM) && !defined(HISX)
  1147. X          if(!tgetflag("bs"))
  1148. X              error("Terminal must backspace.");
  1149. X! #  endif
  1150. X          BC = tbufptr;
  1151. X          tbufptr += 2;
  1152. X          *BC = '\b';
  1153. X!         }
  1154. X! # endif
  1155. X! 
  1156. X  # ifdef MINIMAL_TERM
  1157. X      HO = NULL;
  1158. X  # else
  1159. X***************
  1160. X*** 304,309 ****
  1161. X--- 308,315 ----
  1162. X  # ifdef TERMINFO
  1163. X      VS = Tgetstr("eA");    /* enable graphics */
  1164. X  # endif
  1165. X+     KS = Tgetstr("ks");    /* keypad start (special mode) */
  1166. X+     KE = Tgetstr("ke");    /* keypad end (ordinary mode [ie, digits]) */
  1167. X  # if 0
  1168. X      MB = Tgetstr("mb");    /* blink */
  1169. X      MD = Tgetstr("md");    /* boldface */
  1170. X***************
  1171. X*** 345,350 ****
  1172. X--- 351,373 ----
  1173. X  }
  1174. X  
  1175. X  void
  1176. X+ number_pad(state)
  1177. X+ int state;
  1178. X+ {
  1179. X+     switch (state) {
  1180. X+         case -1:    /* activate keypad mode (escape sequences) */
  1181. X+             if (KS && *KS) xputs(KS);
  1182. X+             break;
  1183. X+         case  1:    /* activate numeric mode for keypad (digits) */
  1184. X+             if (KE && *KE) xputs(KE);
  1185. X+             break;
  1186. X+         case  0:    /* don't need to do anything--leave terminal as-is */
  1187. X+         default:
  1188. X+             break;
  1189. X+     }
  1190. X+ }
  1191. X+ 
  1192. X+ void
  1193. X  start_screen()
  1194. X  {
  1195. X      xputs(TI);
  1196. X***************
  1197. X*** 356,365 ****
  1198. X           * since people may reasonably be using the UK set
  1199. X           */
  1200. X          xputs("\033)0");
  1201. X!         /* 'as' and 'ae' are missing from some termcaps */
  1202. X!         if (!AS) AS = "\016";  /* ^N */
  1203. X!         if (!AE) AE = "\017";  /* ^O */
  1204. X      }
  1205. X  }
  1206. X  
  1207. X  void
  1208. X--- 379,391 ----
  1209. X           * since people may reasonably be using the UK set
  1210. X           */
  1211. X          xputs("\033)0");
  1212. X!         /* these values are missing from some termcaps */
  1213. X!         if (!AS) AS = "\016";    /* ^N (shift-out [graphics font]) */
  1214. X!         if (!AE) AE = "\017";    /* ^O (shift-in  [regular font])  */
  1215. X!         if (!KS) KS = "\033=";    /* ESC= (application keypad mode) */
  1216. X!         if (!KE) KE = "\033>";    /* ESC> (numeric keypad mode)      */
  1217. X      }
  1218. X+     if (flags.num_pad) number_pad(1);    /* make keypad send digits */
  1219. X  }
  1220. X  
  1221. X  void
  1222. X***************
  1223. X*** 390,396 ****
  1224. X  }
  1225. X  #endif
  1226. X  
  1227. X! #endif /* OVLB */
  1228. X  #ifdef OVLB
  1229. X  void
  1230. X  curs(x, y)
  1231. X--- 416,422 ----
  1232. X  }
  1233. X  #endif
  1234. X  
  1235. X! #endif /* OVL0 */
  1236. X  #ifdef OVLB
  1237. X  void
  1238. X  curs(x, y)
  1239. X*** src/timeout.c    Mon May 28 16:48:10 1990
  1240. X--- src/timeout.c    Tue Feb  5 08:55:44 1991
  1241. X***************
  1242. X*** 103,112 ****
  1243. X       */
  1244. X          register int time_luck = stone_luck(FALSE);
  1245. X          boolean nostone = !carrying(LUCKSTONE);
  1246. X  
  1247. X!         if(u.uluck > 0 && (nostone || time_luck < 0))
  1248. X          u.uluck--;
  1249. X!         else if(u.uluck < 0 && (nostone || time_luck > 0))
  1250. X          u.uluck++;
  1251. X      }
  1252. X  
  1253. X--- 103,113 ----
  1254. X       */
  1255. X          register int time_luck = stone_luck(FALSE);
  1256. X          boolean nostone = !carrying(LUCKSTONE);
  1257. X+         int baseluck = (flags.moonphase == FULL_MOON) ? 1 : 0;
  1258. X  
  1259. X!         if(u.uluck > baseluck && (nostone || time_luck < 0))
  1260. X          u.uluck--;
  1261. X!         else if(u.uluck < baseluck && (nostone || time_luck > 0))
  1262. X          u.uluck++;
  1263. X      }
  1264. X  
  1265. X***************
  1266. X*** 130,136 ****
  1267. X              done(POISONING);
  1268. X              break;
  1269. X          case FAST:
  1270. X!             You("feel yourself slowing down.");
  1271. X              break;
  1272. X          case CONFUSION:
  1273. X              HConfusion = 1; /* So make_confused works properly */
  1274. X--- 131,141 ----
  1275. X              done(POISONING);
  1276. X              break;
  1277. X          case FAST:
  1278. X!             if (Fast & ~INTRINSIC) /* boot speed */
  1279. X!                 ;
  1280. X!             else
  1281. X!                 You("feel yourself slowing down%s.",
  1282. X!                             Fast ? " a bit" : "");
  1283. X              break;
  1284. X          case CONFUSION:
  1285. X              HConfusion = 1; /* So make_confused works properly */
  1286. X*** src/topten.c    Sun May 27 20:28:03 1990
  1287. X--- src/topten.c    Wed Jan 30 08:52:00 1991
  1288. X***************
  1289. X*** 1,4 ****
  1290. X! /*    SCCS Id: @(#)topten.c    3.0    89/12/31
  1291. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1292. X  /* NetHack may be freely redistributed.  See license for details. */
  1293. X  
  1294. X--- 1,4 ----
  1295. X! /*    SCCS Id: @(#)topten.c    3.0    91/01/20
  1296. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1297. X  /* NetHack may be freely redistributed.  See license for details. */
  1298. X  
  1299. X***************
  1300. X*** 7,24 ****
  1301. X  /* block some unused #defines to avoid overloading some cpp's */
  1302. X  #include "hack.h"
  1303. X  
  1304. X! #ifndef MACOS
  1305. X  #include <errno.h>    /* George Barbanis */
  1306. X! #else
  1307. X  extern short macflags;
  1308. X  extern WindowPtr    HackWindow;
  1309. X  #endif
  1310. X  
  1311. X- #ifdef NO_FILE_LINKS
  1312. X- #include <fcntl.h>    /* Ralf Brown */
  1313. X- #endif
  1314. X- #include <ctype.h>
  1315. X- 
  1316. X  #ifdef NO_SCAN_BRACK
  1317. X  static void FDECL(nsb_mung_line,(char*));
  1318. X  static void FDECL(nsb_unmung_line,(char*));
  1319. X--- 7,26 ----
  1320. X  /* block some unused #defines to avoid overloading some cpp's */
  1321. X  #include "hack.h"
  1322. X  
  1323. X! #if defined(UNIX) || defined(VMS)
  1324. X  #include <errno.h>    /* George Barbanis */
  1325. X! extern int errno;
  1326. X! # if defined(NO_FILE_LINKS) && !defined(O_WRONLY)
  1327. X! #include <fcntl.h>    /* Ralf Brown */
  1328. X! # endif
  1329. X! #endif    /* UNIX || VMS */
  1330. X! #include <ctype.h>
  1331. X! 
  1332. X! #ifdef MACOS
  1333. X  extern short macflags;
  1334. X  extern WindowPtr    HackWindow;
  1335. X  #endif
  1336. X  
  1337. X  #ifdef NO_SCAN_BRACK
  1338. X  static void FDECL(nsb_mung_line,(char*));
  1339. X  static void FDECL(nsb_unmung_line,(char*));
  1340. X***************
  1341. X*** 142,148 ****
  1342. X  # endif
  1343. X  #endif /* UNIX */
  1344. X  #ifdef VMS
  1345. X!     char *reclock = "record_lock;1";
  1346. X      char recfile[] = RECORD;
  1347. X  #else
  1348. X      const char *recfile = RECORD;
  1349. X--- 144,150 ----
  1350. X  # endif
  1351. X  #endif /* UNIX */
  1352. X  #ifdef VMS
  1353. X!     const char *reclock = "record.lock;1";
  1354. X      char recfile[] = RECORD;
  1355. X  #else
  1356. X      const char *recfile = RECORD;
  1357. X***************
  1358. X*** 159,165 ****
  1359. X      char *loglock = "logfile_lock";
  1360. X  # endif /* UNIX */
  1361. X  # ifdef VMS
  1362. X!     char *loglock = "logfile_lock;1";
  1363. X  # endif /* VMS */
  1364. X  # if defined(UNIX) || defined(VMS)
  1365. X      int sleeplgct = 30;
  1366. X--- 161,167 ----
  1367. X      char *loglock = "logfile_lock";
  1368. X  # endif /* UNIX */
  1369. X  # ifdef VMS
  1370. X!     const char *loglock = "logfile.lock;1";
  1371. X  # endif /* VMS */
  1372. X  # if defined(UNIX) || defined(VMS)
  1373. X      int sleeplgct = 30;
  1374. X***************
  1375. X*** 216,223 ****
  1376. X  #  else
  1377. X      while(link(lgfile, loglock) == -1) {
  1378. X  #  endif /* NO_FILE_LINKS */
  1379. X-         extern int errno;
  1380. X- 
  1381. X          if (errno == ENOENT) /* If no such file, do not keep log */
  1382. X              goto lgend;  /* George Barbanis */
  1383. X          HUP perror(loglock);
  1384. X--- 218,223 ----
  1385. X***************
  1386. X*** 244,261 ****
  1387. X  # if defined(UNIX) || defined(VMS)
  1388. X      (void) unlink(loglock);
  1389. X  # endif /* UNIX or VMS */
  1390. X!       lgend:;
  1391. X  # ifdef NO_FILE_LINKS
  1392. X      (void) close(lockfd) ;
  1393. X  # endif
  1394. X! # if defined(WIZARD) || defined(EXPLORE_MODE)
  1395. X      if (wizard || discover) {
  1396. X   Printf("\nSince you were in %s mode, the score list will not be checked.\n",
  1397. X      wizard ? "wizard" : "discover");
  1398. X          return;
  1399. X      }
  1400. X! # endif
  1401. X! #endif /* LOGFILE */
  1402. X  
  1403. X  #if defined(UNIX) || defined(VMS)
  1404. X  # ifdef NO_FILE_LINKS
  1405. X--- 244,263 ----
  1406. X  # if defined(UNIX) || defined(VMS)
  1407. X      (void) unlink(loglock);
  1408. X  # endif /* UNIX or VMS */
  1409. X!  lgend: ;
  1410. X  # ifdef NO_FILE_LINKS
  1411. X      (void) close(lockfd) ;
  1412. X+     free((genericptr_t) loglock) ;
  1413. X  # endif
  1414. X! #endif /* LOGFILE */
  1415. X! 
  1416. X! #if defined(WIZARD) || defined(EXPLORE_MODE)
  1417. X      if (wizard || discover) {
  1418. X   Printf("\nSince you were in %s mode, the score list will not be checked.\n",
  1419. X      wizard ? "wizard" : "discover");
  1420. X          return;
  1421. X      }
  1422. X! #endif
  1423. X  
  1424. X  #if defined(UNIX) || defined(VMS)
  1425. X  # ifdef NO_FILE_LINKS
  1426. X***************
  1427. X*** 289,301 ****
  1428. X          
  1429. X          t = (term_info *)GetWRefCon(HackWindow);
  1430. X          SetVol((StringPtr)0L, t->recordVRefNum);
  1431. X!         if (!(rfile = fopen(recfile,"r"))) {
  1432. X!             short    i;
  1433. X!     
  1434. X              rfile = openFile(recfile,"r");
  1435. X-         }
  1436. X      }
  1437. X- 
  1438. X      if (!rfile) {
  1439. X  #else
  1440. X      if(!(rfile = fopen(recfile,"r"))){
  1441. X--- 291,299 ----
  1442. X          
  1443. X          t = (term_info *)GetWRefCon(HackWindow);
  1444. X          SetVol((StringPtr)0L, t->recordVRefNum);
  1445. X!         if (!(rfile = fopen(recfile,"r")))
  1446. X              rfile = openFile(recfile,"r");
  1447. X      }
  1448. X      if (!rfile) {
  1449. X  #else
  1450. X      if(!(rfile = fopen(recfile,"r"))){
  1451. X***************
  1452. X*** 303,311 ****
  1453. X          HUP (void) puts("Cannot open record file!");
  1454. X          goto unlock;
  1455. X      }
  1456. X- #ifdef NO_FILE_LINKS
  1457. X-     (void) close(lockfd) ;
  1458. X- #endif
  1459. X      HUP (void) putchar('\n');
  1460. X  
  1461. X      /* assure minimum number of points */
  1462. X--- 301,306 ----
  1463. X***************
  1464. X*** 359,370 ****
  1465. X      if(flg) {    /* rewrite record file */
  1466. X          (void) fclose(rfile);
  1467. X  #ifdef VMS
  1468. X!         {
  1469. X!             char *sem = rindex(recfile, ';');
  1470. X! 
  1471. X!             if (sem)
  1472. X!                 *sem = '\0';
  1473. X!         }
  1474. X  #endif
  1475. X          if(!(rfile = fopen(recfile,"w"))){
  1476. X              HUP (void) puts("Cannot write record file\n");
  1477. X--- 354,362 ----
  1478. X      if(flg) {    /* rewrite record file */
  1479. X          (void) fclose(rfile);
  1480. X  #ifdef VMS
  1481. X!         {    char *semi_colon = rindex(recfile, ';');
  1482. X!         if (semi_colon) *semi_colon = '\0';
  1483. X!         }
  1484. X  #endif
  1485. X          if(!(rfile = fopen(recfile,"w"))){
  1486. X              HUP (void) puts("Cannot write record file\n");
  1487. X***************
  1488. X*** 441,451 ****
  1489. X  #endif
  1490. X  unlock:    ;
  1491. X  #if defined(UNIX) || defined(VMS)
  1492. X  # ifdef NO_FILE_LINKS
  1493. X      (void) close(lockfd) ;
  1494. X  # endif
  1495. X-     if (unlink(reclock) < 0)
  1496. X-         Printf("Can't unlink %s\n",reclock) ;
  1497. X  #endif
  1498. X  }
  1499. X  
  1500. X--- 433,444 ----
  1501. X  #endif
  1502. X  unlock:    ;
  1503. X  #if defined(UNIX) || defined(VMS)
  1504. X+     if (unlink(reclock) < 0)
  1505. X+         Printf("Can't unlink %s\n",reclock) ;
  1506. X  # ifdef NO_FILE_LINKS
  1507. X      (void) close(lockfd) ;
  1508. X+     free((genericptr_t) reclock) ;
  1509. X  # endif
  1510. X  #endif
  1511. X  }
  1512. X  
  1513. X***************
  1514. X*** 474,480 ****
  1515. X      char linebuf[BUFSZ], linebuf2[BUFSZ];
  1516. X  
  1517. X      linebuf[0] = linebuf2[0] = 0;
  1518. X!     if(rank) Sprintf(eos(linebuf), " %2d", rank);
  1519. X      else Strcat(linebuf, "   ");
  1520. X  
  1521. X      Sprintf(eos(linebuf), " %10ld  %.10s", t1->points, t1->name);
  1522. X--- 467,473 ----
  1523. X      char linebuf[BUFSZ], linebuf2[BUFSZ];
  1524. X  
  1525. X      linebuf[0] = linebuf2[0] = 0;
  1526. X!     if(rank) Sprintf(eos(linebuf), "%3d", rank);
  1527. X      else Strcat(linebuf, "   ");
  1528. X  
  1529. X      Sprintf(eos(linebuf), " %10ld  %.10s", t1->points, t1->name);
  1530. X*** src/trap.c    Tue Jun 26 21:20:36 1990
  1531. X--- src/trap.c    Sat Feb  2 16:58:28 1991
  1532. X***************
  1533. X*** 40,45 ****
  1534. X--- 40,46 ----
  1535. X  
  1536. X  #ifdef OVLB
  1537. X  
  1538. X+ static int FDECL(teleok, (int,int,BOOLEAN_P));
  1539. X  static void NDECL(vtele);
  1540. X  
  1541. X  /* Generic rust-armor function.  Returns TRUE if a message was printed;
  1542. X***************
  1543. X*** 99,118 ****
  1544. X  {
  1545. X      register struct trap *ttmp;
  1546. X      register struct permonst *ptr;
  1547. X  
  1548. X      if (ttmp = t_at(x,y)) {
  1549. X!         if (u.utrap &&
  1550. X!           ((u.utraptype == TT_BEARTRAP && typ != BEAR_TRAP) ||
  1551. X!           (u.utraptype == TT_WEB && typ != WEB) ||
  1552. X!           (u.utraptype == TT_PIT && typ != PIT && typ != SPIKED_PIT)))
  1553. X!             u.utrap = 0;
  1554. X!         ttmp->ttyp = typ;
  1555. X!         return ttmp;
  1556. X      }
  1557. X-     ttmp = newtrap();
  1558. X      ttmp->ttyp = typ;
  1559. X-     ttmp->tx = x;
  1560. X-     ttmp->ty = y;
  1561. X      switch(typ) {
  1562. X          case MONST_TRAP:        /* create a monster in "hiding" */
  1563. X          {    int tryct = 0;
  1564. X--- 100,121 ----
  1565. X  {
  1566. X      register struct trap *ttmp;
  1567. X      register struct permonst *ptr;
  1568. X+     register boolean oldplace;
  1569. X  
  1570. X      if (ttmp = t_at(x,y)) {
  1571. X!         oldplace = TRUE;
  1572. X!         if (u.utrap && (x == u.ux) && (y == u.uy) && 
  1573. X!           ((u.utraptype == TT_BEARTRAP && typ != BEAR_TRAP) ||
  1574. X!           (u.utraptype == TT_WEB && typ != WEB) ||
  1575. X!           (u.utraptype == TT_PIT && typ != PIT && typ != SPIKED_PIT)))
  1576. X!             u.utrap = 0;
  1577. X!     } else {
  1578. X!         oldplace = FALSE;
  1579. X!         ttmp = newtrap();
  1580. X!         ttmp->tx = x;
  1581. X!         ttmp->ty = y;
  1582. X      }
  1583. X      ttmp->ttyp = typ;
  1584. X      switch(typ) {
  1585. X          case MONST_TRAP:        /* create a monster in "hiding" */
  1586. X          {    int tryct = 0;
  1587. X***************
  1588. X*** 123,129 ****
  1589. X          } while ((noattacks(&mons[ttmp->pm]) ||
  1590. X              !mons[ttmp->pm].mmove) && ++tryct < 100);
  1591. X          if (tryct == 100) {
  1592. X!             free((genericptr_t)ttmp);
  1593. X              return(struct trap *)0;
  1594. X          }
  1595. X          break;
  1596. X--- 126,135 ----
  1597. X          } while ((noattacks(&mons[ttmp->pm]) ||
  1598. X              !mons[ttmp->pm].mmove) && ++tryct < 100);
  1599. X          if (tryct == 100) {
  1600. X!             if (oldplace)
  1601. X!                 deltrap(ttmp);
  1602. X!             else
  1603. X!                 free((genericptr_t)ttmp);
  1604. X              return(struct trap *)0;
  1605. X          }
  1606. X          break;
  1607. X***************
  1608. X*** 138,184 ****
  1609. X      }
  1610. X      ttmp->tseen = 0;
  1611. X      ttmp->once = 0;
  1612. X!     ttmp->ntrap = ftrap;
  1613. X!     ftrap = ttmp;
  1614. X      return(ttmp);
  1615. X  }
  1616. X  
  1617. X! int
  1618. X! teleok(x, y)
  1619. X  register int x, y;
  1620. X  {                /* might throw him into a POOL
  1621. X                   * removed by GAN 10/20/86
  1622. X                   */
  1623. X  #ifdef STUPID
  1624. X      boolean    tmp1, tmp2, tmp3;
  1625. X! #  ifdef POLYSELF
  1626. X      tmp1 = isok(x,y) && (!IS_ROCK(levl[x][y].typ) ||
  1627. X          passes_walls(uasmon)) && !MON_AT(x, y);
  1628. X! #  else
  1629. X      tmp1 = isok(x,y) && !IS_ROCK(levl[x][y].typ) && !MON_AT(x, y);
  1630. X! #  endif
  1631. X!     tmp2 = !sobj_at(BOULDER,x,y) && !t_at(x,y);
  1632. X      tmp3 = !(is_pool(x,y) &&
  1633. X             !(Levitation || Wwalking
  1634. X! #ifdef POLYSELF
  1635. X           || is_flyer(uasmon)
  1636. X! #endif
  1637. X          )) && !closed_door(x,y);
  1638. X      return(tmp1 && tmp2 && tmp3);
  1639. X  #else
  1640. X      return( isok(x,y) &&
  1641. X! #  ifdef POLYSELF
  1642. X          (!IS_ROCK(levl[x][y].typ) || passes_walls(uasmon)) &&
  1643. X! #  else
  1644. X          !IS_ROCK(levl[x][y].typ) &&
  1645. X! #  endif
  1646. X          !MON_AT(x, y) &&
  1647. X!         !sobj_at(BOULDER,x,y) && !t_at(x,y) &&
  1648. X          !(is_pool(x,y) &&
  1649. X          !(Levitation || Wwalking
  1650. X! #ifdef POLYSELF
  1651. X            || is_flyer(uasmon)
  1652. X! #endif
  1653. X            )) && !closed_door(x,y));
  1654. X  #endif
  1655. X      /* Note: gold is permitted (because of vaults) */
  1656. X--- 144,193 ----
  1657. X      }
  1658. X      ttmp->tseen = 0;
  1659. X      ttmp->once = 0;
  1660. X!     if (!oldplace) {
  1661. X!         ttmp->ntrap = ftrap;
  1662. X!         ftrap = ttmp;
  1663. X!     }
  1664. X      return(ttmp);
  1665. X  }
  1666. X  
  1667. X! static int
  1668. X! teleok(x, y, trapok)
  1669. X  register int x, y;
  1670. X+ boolean trapok;
  1671. X  {                /* might throw him into a POOL
  1672. X                   * removed by GAN 10/20/86
  1673. X                   */
  1674. X  #ifdef STUPID
  1675. X      boolean    tmp1, tmp2, tmp3;
  1676. X! # ifdef POLYSELF
  1677. X      tmp1 = isok(x,y) && (!IS_ROCK(levl[x][y].typ) ||
  1678. X          passes_walls(uasmon)) && !MON_AT(x, y);
  1679. X! # else
  1680. X      tmp1 = isok(x,y) && !IS_ROCK(levl[x][y].typ) && !MON_AT(x, y);
  1681. X! # endif
  1682. X!     tmp2 = !sobj_at(BOULDER,x,y) && (trapok || !t_at(x,y));
  1683. X      tmp3 = !(is_pool(x,y) &&
  1684. X             !(Levitation || Wwalking
  1685. X! # ifdef POLYSELF
  1686. X           || is_flyer(uasmon)
  1687. X! # endif
  1688. X          )) && !closed_door(x,y);
  1689. X      return(tmp1 && tmp2 && tmp3);
  1690. X  #else
  1691. X      return( isok(x,y) &&
  1692. X! # ifdef POLYSELF
  1693. X          (!IS_ROCK(levl[x][y].typ) || passes_walls(uasmon)) &&
  1694. X! # else
  1695. X          !IS_ROCK(levl[x][y].typ) &&
  1696. X! # endif
  1697. X          !MON_AT(x, y) &&
  1698. X!         !sobj_at(BOULDER,x,y) && (trapok || !t_at(x,y)) &&
  1699. X          !(is_pool(x,y) &&
  1700. X          !(Levitation || Wwalking
  1701. X! # ifdef POLYSELF
  1702. X            || is_flyer(uasmon)
  1703. X! # endif
  1704. X            )) && !closed_door(x,y));
  1705. X  #endif
  1706. X      /* Note: gold is permitted (because of vaults) */
  1707. X***************
  1708. X*** 194,200 ****
  1709. X  
  1710. X          x = rn2(2) ? croom->lx : croom->hx;
  1711. X          y = rn2(2) ? croom->ly : croom->hy;
  1712. X!         if(teleok(x,y)) {
  1713. X              teleds(x,y);
  1714. X              return;
  1715. X          }
  1716. X--- 203,209 ----
  1717. X  
  1718. X          x = rn2(2) ? croom->lx : croom->hx;
  1719. X          y = rn2(2) ? croom->ly : croom->hy;
  1720. X!         if(teleok(x,y,FALSE)) {
  1721. X              teleds(x,y);
  1722. X              return;
  1723. X          }
  1724. X***************
  1725. X*** 252,257 ****
  1726. X--- 261,267 ----
  1727. X      register int ttype = trap->ttyp;
  1728. X      register struct monst *mtmp;
  1729. X      register struct obj *otmp;
  1730. X+     int pm = trap->pm;
  1731. X  
  1732. X      nomul(0);
  1733. X      if(trap->tseen && !Fumbling && !(ttype == PIT
  1734. X***************
  1735. X*** 307,314 ****
  1736. X              deltrap(trap);
  1737. X              for(otmp=level.objects[u.ux][u.uy];
  1738. X                          otmp; otmp = otmp->nexthere)
  1739. X!             if(otmp->otyp == STATUE && otmp->corpsenm == trap->pm)
  1740. X!                 if(mtmp=makemon(&mons[trap->pm],u.ux,u.uy)) {
  1741. X                  pline("The statue comes to life!");
  1742. X                  delobj(otmp);
  1743. X                  break;
  1744. X--- 317,324 ----
  1745. X              deltrap(trap);
  1746. X              for(otmp=level.objects[u.ux][u.uy];
  1747. X                          otmp; otmp = otmp->nexthere)
  1748. X!             if(otmp->otyp == STATUE && otmp->corpsenm == pm)
  1749. X!                 if(mtmp=makemon(&mons[pm],u.ux,u.uy)) {
  1750. X                  pline("The statue comes to life!");
  1751. X                  delobj(otmp);
  1752. X                  break;
  1753. X***************
  1754. X*** 315,321 ****
  1755. X                  }
  1756. X              break;
  1757. X          case MONST_TRAP:
  1758. X!             if(mtmp=makemon(&mons[trap->pm],u.ux,u.uy)) {
  1759. X                mtmp->mpeaceful = FALSE;
  1760. X                switch(mtmp->data->mlet) {
  1761. X              case S_PIERCER:
  1762. X--- 325,332 ----
  1763. X                  }
  1764. X              break;
  1765. X          case MONST_TRAP:
  1766. X!             deltrap(trap);
  1767. X!             if(mtmp=makemon(&mons[pm],u.ux,u.uy)) {
  1768. X                mtmp->mpeaceful = FALSE;
  1769. X                switch(mtmp->data->mlet) {
  1770. X              case S_PIERCER:
  1771. X***************
  1772. X*** 333,339 ****
  1773. X                  break;
  1774. X                }
  1775. X              }
  1776. X-             deltrap(trap);
  1777. X              break;
  1778. X          case ARROW_TRAP:
  1779. X              pline("An arrow shoots out at you!");
  1780. X--- 344,349 ----
  1781. X***************
  1782. X*** 562,581 ****
  1783. X              You("feel momentarily different.");
  1784. X              /* Trap did nothing; don't remove it --KAA */
  1785. X              } else {
  1786. X              You("feel a change coming over you.");
  1787. X              polyself();
  1788. X-             deltrap(trap);
  1789. X              }
  1790. X              break;
  1791. X  #endif
  1792. X          case MGTRP:        /* A magic trap. */
  1793. X              if (!rn2(30)) {
  1794. X-             You("are caught in a magical explosion!");
  1795. X-             losehp(rnd(10), "magical explosion", KILLED_BY_AN);
  1796. X- #ifdef SPELLS
  1797. X-             Your("body absorbs some of the magical energy!");
  1798. X-             u.uen = (u.uenmax += 2);
  1799. X- #endif
  1800. X              deltrap(trap);
  1801. X              if(Invisible
  1802. X  #ifdef POLYSELF
  1803. X--- 572,585 ----
  1804. X              You("feel momentarily different.");
  1805. X              /* Trap did nothing; don't remove it --KAA */
  1806. X              } else {
  1807. X+             deltrap(trap);
  1808. X              You("feel a change coming over you.");
  1809. X              polyself();
  1810. X              }
  1811. X              break;
  1812. X  #endif
  1813. X          case MGTRP:        /* A magic trap. */
  1814. X              if (!rn2(30)) {
  1815. X              deltrap(trap);
  1816. X              if(Invisible
  1817. X  #ifdef POLYSELF
  1818. X***************
  1819. X*** 582,587 ****
  1820. X--- 586,597 ----
  1821. X                  && !u.uundetected
  1822. X  #endif
  1823. X                          ) newsym(u.ux,u.uy);
  1824. X+             You("are caught in a magical explosion!");
  1825. X+             losehp(rnd(10), "magical explosion", KILLED_BY_AN);
  1826. X+ #ifdef SPELLS
  1827. X+             Your("body absorbs some of the magical energy!");
  1828. X+             u.uen = (u.uenmax += 2);
  1829. X+ #endif
  1830. X              } else domagictrap();
  1831. X              break;
  1832. X          case SQBRD:        /* stepped on a squeaky board */
  1833. X***************
  1834. X*** 1058,1064 ****
  1835. X  void
  1836. X  tele() {
  1837. X      coord cc;
  1838. X!     register int nux,nuy;
  1839. X  
  1840. X  #ifdef STRONGHOLD
  1841. X      /* Disable teleportation in stronghold && Vlad's Tower */
  1842. X--- 1068,1075 ----
  1843. X  void
  1844. X  tele() {
  1845. X      coord cc;
  1846. X!     register int nux, nuy;
  1847. X!     short tcnt = 0;
  1848. X  
  1849. X  #ifdef STRONGHOLD
  1850. X      /* Disable teleportation in stronghold && Vlad's Tower */
  1851. X***************
  1852. X*** 1081,1087 ****
  1853. X          You("feel disoriented for a moment.");
  1854. X          return;
  1855. X      }
  1856. X!     if(Teleport_control) {
  1857. X          if (unconscious())
  1858. X          pline("Being unconscious, you cannot control your teleport.");
  1859. X          else {
  1860. X--- 1092,1102 ----
  1861. X          You("feel disoriented for a moment.");
  1862. X          return;
  1863. X      }
  1864. X!     if(Teleport_control
  1865. X! #ifdef WIZARD
  1866. X!                 || wizard
  1867. X! #endif
  1868. X!                     ) {
  1869. X          if (unconscious())
  1870. X          pline("Being unconscious, you cannot control your teleport.");
  1871. X          else {
  1872. X***************
  1873. X*** 1091,1097 ****
  1874. X              getpos(&cc, 1, "the desired position"); /* 1: force valid */
  1875. X              /* possible extensions: introduce a small error if
  1876. X                 magic power is low; allow transfer to solid rock */
  1877. X!             if(teleok(cc.x, cc.y)){
  1878. X              teleds(cc.x, cc.y);
  1879. X              return;
  1880. X              }
  1881. X--- 1106,1112 ----
  1882. X              getpos(&cc, 1, "the desired position"); /* 1: force valid */
  1883. X              /* possible extensions: introduce a small error if
  1884. X                 magic power is low; allow transfer to solid rock */
  1885. X!             if(teleok(cc.x, cc.y, FALSE)){
  1886. X              teleds(cc.x, cc.y);
  1887. X              return;
  1888. X              }
  1889. X***************
  1890. X*** 1098,1108 ****
  1891. X              pline("Sorry...");
  1892. X          }
  1893. X      }
  1894. X      do {
  1895. X          nux = rnd(COLNO-1);
  1896. X          nuy = rn2(ROWNO);
  1897. X!     } while(!teleok(nux, nuy));
  1898. X!     teleds(nux, nuy);
  1899. X  }
  1900. X  
  1901. X  void
  1902. X--- 1113,1124 ----
  1903. X              pline("Sorry...");
  1904. X          }
  1905. X      }
  1906. X+ 
  1907. X      do {
  1908. X          nux = rnd(COLNO-1);
  1909. X          nuy = rn2(ROWNO);
  1910. X!     } while (!teleok(nux, nuy, tcnt>200) && tcnt++ < 400);
  1911. X!     if (tcnt < 400) teleds(nux, nuy);
  1912. X  }
  1913. X  
  1914. X  void
  1915. X***************
  1916. X*** 1219,1229 ****
  1917. X  
  1918. X  #ifdef SPELLS
  1919. X      if (castit)
  1920. X  # ifdef WIZARD
  1921. X!         if (!spelleffects(++sp_no, TRUE) && !wizard) return(0);
  1922. X! # else
  1923. X!         return spelleffects(++sp_no, TRUE);
  1924. X  # endif
  1925. X  #endif
  1926. X  
  1927. X  #ifdef WALKIES
  1928. X--- 1235,1247 ----
  1929. X  
  1930. X  #ifdef SPELLS
  1931. X      if (castit)
  1932. X+         if (spelleffects(++sp_no, TRUE))
  1933. X+             return(1);
  1934. X+         else
  1935. X  # ifdef WIZARD
  1936. X!             if (!wizard)
  1937. X  # endif
  1938. X+             return(0);
  1939. X  #endif
  1940. X  
  1941. X  #ifdef WALKIES
  1942. X*** src/uhitm.c    Tue Jun 26 21:20:37 1990
  1943. X--- src/uhitm.c    Sat Jan  5 15:08:19 1991
  1944. X***************
  1945. X*** 70,75 ****
  1946. X--- 70,80 ----
  1947. X      if (mon->mtame) {
  1948. X          struct monst *m3;
  1949. X  
  1950. X+         /* because m2 is a copy of mon it is tame but not init'ed.
  1951. X+          * however, tamedog will not re-tame a tame dog, so m2
  1952. X+          * must be made non-tame to get initialized properly.
  1953. X+          */
  1954. X+         m2->mtame = 0;
  1955. X          if (m3 = tamedog(m2, (struct obj *)0))
  1956. X          m2 = m3;
  1957. X      }
  1958. X*** src/unixmain.c    Thu May 24 23:00:42 1990
  1959. X--- src/unixmain.c    Sat Jan  5 15:00:05 1991
  1960. X***************
  1961. X*** 345,351 ****
  1962. X      flags.moonphase = phase_of_the_moon();
  1963. X      if(flags.moonphase == FULL_MOON) {
  1964. X          You("are lucky!  Full moon tonight.");
  1965. X!         if(!u.uluck) change_luck(1);
  1966. X      } else if(flags.moonphase == NEW_MOON) {
  1967. X          pline("Be careful!  New moon tonight.");
  1968. X      }
  1969. X--- 345,351 ----
  1970. X      flags.moonphase = phase_of_the_moon();
  1971. X      if(flags.moonphase == FULL_MOON) {
  1972. X          You("are lucky!  Full moon tonight.");
  1973. X!         change_luck(1);
  1974. X      } else if(flags.moonphase == NEW_MOON) {
  1975. X          pline("Be careful!  New moon tonight.");
  1976. X      }
  1977. X*** src/unixtty.c    Sun Mar  4 13:44:10 1990
  1978. X--- src/unixtty.c    Tue Jan 15 17:50:55 1991
  1979. X***************
  1980. X*** 37,42 ****
  1981. X--- 37,45 ----
  1982. X  #define cbrkflgs    c_lflag
  1983. X  #define CBRKMASK    ICANON
  1984. X  #define CBRKON        ! /* reverse condition */
  1985. X+ #ifndef CBAUD
  1986. X+ # define CBAUD        _CBAUD /* for POSIX nitpickers (like RS/6000 cc) */
  1987. X+ #endif
  1988. X  #define OSPEED(x)    ((x).c_cflag & CBAUD)
  1989. X  #define IS_7BIT(x)    ((x).c_cflag & CS7)
  1990. X  #define inputflags    c_iflag
  1991. X*** src/unixunix.c    Tue Apr 17 23:57:36 1990
  1992. X--- src/unixunix.c    Wed Jan 30 08:49:06 1991
  1993. X***************
  1994. X*** 112,118 ****
  1995. X  static struct stat buf, hbuf;
  1996. X  
  1997. X  void
  1998. X! gethdate(name) char *name; {
  1999. X  /* old version - for people short of space */
  2000. X  /*
  2001. X  /* register char *np;
  2002. X--- 112,118 ----
  2003. X  static struct stat buf, hbuf;
  2004. X  
  2005. X  void
  2006. X! gethdate(name) const char *name; {
  2007. X  /* old version - for people short of space */
  2008. X  /*
  2009. X  /* register char *np;
  2010. X*** src/zap.c    Tue Jun 26 21:20:41 1990
  2011. X--- src/zap.c    Sun Jan  6 15:55:18 1991
  2012. X***************
  2013. X*** 1517,1523 ****
  2014. X--- 1517,1530 ----
  2015. X              } else {
  2016. X  #endif
  2017. X                  lev->typ = ROOM;
  2018. X+ #ifdef STUPID
  2019. X+                 if (moat)
  2020. X+                     lev->icedpool = ICED_MOAT;
  2021. X+                 else
  2022. X+                     lev->icedpool = ICED_POOL;
  2023. X+ #else
  2024. X                  lev->icedpool = (moat ? ICED_MOAT : ICED_POOL);
  2025. X+ #endif
  2026. X  #ifdef STRONGHOLD
  2027. X              }
  2028. X  #endif
  2029. X
  2030. END_OF_FILE
  2031. if test 52441 -ne `wc -c <'patch10.03'`; then
  2032.     echo shar: \"'patch10.03'\" unpacked with wrong size!
  2033. fi
  2034. # end of 'patch10.03'
  2035. echo shar: End of archive 2 \(of 8\).
  2036. cp /dev/null ark2isdone
  2037. MISSING=""
  2038. for I in 1 2 3 4 5 6 7 8 ; do
  2039.     if test ! -f ark${I}isdone ; then
  2040.     MISSING="${MISSING} ${I}"
  2041.     fi
  2042. done
  2043. if test "${MISSING}" = "" ; then
  2044.     echo You have unpacked all 8 archives.
  2045.     rm -f ark[1-9]isdone
  2046. else
  2047.     echo You still need to unpack the following archives:
  2048.     echo "        " ${MISSING}
  2049. fi
  2050. ##  End of shell archive.
  2051. exit 0
  2052.